﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace CKS.EBE.WebControls
{
    public class XmlFeed : XmlBasedControl
    {
        private string _xmlFeedUrl;

        public string XmlFeedUrl
        {
            get { return _xmlFeedUrl; }
            set { _xmlFeedUrl = value; }
        }

        protected override System.Xml.XmlDocument BuildDocument()
        {
            try
            {
                XmlDocument document = new XmlDocument();
                document.Load(XmlFeedUrl);
                return document;
            }
            catch (Exception exception)
            {
                System.Diagnostics.Trace.WriteLine("Failed to retrive XML feed: " + XmlFeedUrl);
                System.Diagnostics.Trace.WriteLine(exception);
                return null;
            }

        }
    }
}
